Skip to content

Conversation

@Lettuceleaves
Copy link

说明

  1. 提供 core 模块下的 text 中布隆过滤器的单过滤器多哈希函数支持
  2. 我发现原来的 hash 方法可能会导致 indexOutOfBoundsException

修改描述

  1. 使用可变参数允许接收多个哈希函数,重写 contains 方法和 add 方法
  2. 修复 indexOutOfBoundsException,在原来的代码中,如果 hash 结果是 Integer.MIN_VALUE,调用者在尝试用 Math.abs()保证结果为正时,由于不存在对应的正数,会导致结果仍为 Integer.MIN_VALUE,使得调用 bitSet.set(hash) 时 hash 参数为负数,发生 indexOutOfBoundsException
2f36fb93159f536b5c3716442e845f93

该测试仅用于说明潜在问题,所以已在 pr 中删除

提交前自测

已通过mvn javadoc:javadoc 测试
mvn clean test 测试在 core 模块通过了但是在 poi 模块失败了,我不知道为什么,但我没有修改 poi 模块

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant